package com.luban.springboot.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurationSupport{
	
	@Value("${img.resImgPath}")
	private String resImgPath;
	
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		//静态资源文件访问
        registry.addResourceHandler("/luban/**").addResourceLocations(resImgPath);
	}

}
